<!--
 * @Author: g05047
 * @Date: 2021-07-28 09:57:18
 * @LastEditors: g05047
 * @LastEditTime: 2021-07-28 16:36:53
 * @Description: file content
-->
<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { timestamp } from "@/utils/token"

import axios from 'axios';
const service = axios.create({
  // timeout: 30000, // request timeout
});
service.interceptors.request.use(
  config => {
    // Do something before request is sent
    // if (getToken()) {
    //   // 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
    //   // config.headers['X-Token'] = getToken()
    //   config.headers.Authorization = getToken();
    // }


    //  let timestamp= sessionStorage.getItem('timestamp')
    //   if(timestamp){

    //   }
    config.headers.timestamp = timestamp();

    return config;
  },
  error => {
    // Do something with request error
    console.log(error); // for debug
    Promise.reject(error);
  }
);
export default {
  name: "app",
  data() {
    return {};
  },
  components: {},
  created() {
      // this.test()
  },
  methods: {
    test() {
      service
        .get("https://spaq.suzhou.gov.cn/test-ssa-api/scheduler/sendHCScheduler?type=8&unitId=202110290001", {})
        .then((res) => {
          console.log(red);
          // console.timeEnd();
        //  setTimeout(()=>{
        //     this.test()
        //  },480000)
        }).catch((err) => {
        //    console.timeEnd();
        //       setTimeout(()=>{
        //     this.test()
        //  },480000)
        })
    },
  },
};
</script>

<style>
/* #app {} */
</style>
